package com.example.healthmanagement.dao;

import com.example.healthmanagement.entity.Bmi;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BmiRepository extends JpaRepository<Bmi, Long> {

    Bmi findBmiById(int id);

    @Query("SELECT u FROM Bmi u WHERE u.bmiLeft <= :bmi and u.bmiRight > :bmi")
    Bmi findBmiByValue(double bmi);
}
